<template>
  <view class="xuni-tabbar-bottom" :style="'background: '+bgColor+';'">
    <view style="height: 150rpx;"></view>
    <view class="uni-flex uni-row" style="color:#FFFFFF;height: 80rpx;line-height: 80rpx;font-weight: bold;padding:0rpx 60rpx;">
      <view class="flex-item" style="width:5%" @click="xGoBack()">
        <uni-icons type="back" size="25" color="#FFFFFF"></uni-icons>
      </view>
      <view class="flex-item" style="width:90%;text-align: center;">
        {{title}}
      </view>
    </view>
  </view>
</template>
<script>
import x from '@/common/base.js';
export default {
  name: "headBar",
  data() {
    return {
      bgColor:'#45d484'
    }
  },


  mounted: function () {
    this.setBgColor();
  },

  methods: {
    setBgColor(){
      var t =this;
      if(t.color){
        t.bgColor = t.color;
      }
    },
    // 后退
    xGoBack(){
      var t = this;
      // var pagesList = t.xCacheGet('pagesList');
      // if(!pagesList){
      //   pagesList = [];
      // }
      // if(pagesList.length > 0){
      //   var shortPageList = pagesList.slice(0, -1);
      //   if(shortPageList.length > 0){
      //     let lastElement = shortPageList[shortPageList.length-1];
      //     t.xCacheSet('pagesList',shortPageList);
      //     t.x_redirect(lastElement);
      //   }
      // }
      t.x_back()
    }
  },
  props: ["title","color"],
};
</script>
<style>


</style>
